package com.example.microserviceeurekaproduct.Controller;

import com.example.microserviceeurekaproduct.pojo.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author liuyulong
 * @create 2022-03-16 17:19
 * @create 2022-三月  星期三
 * @project Microservice-SpringCloud_work2_2022_3_16
 */
@RestController
public class proController {

    @GetMapping("/product/{num}")
    public String toGet(@PathVariable String num){
        Product product = new Product();
        product.setId(Integer.valueOf(num));
        product.setProductName("手表");
        product.setStatus("已付款");
        product.setPrice(500);
        return product.toString();
    }
}
